/////////////////////////////////////////////////////////////////////////////// 
//Filename: Ship.java
//
//Authors: Noah Wonhala & Scott Cavanaugh
//
//Description:  Framework of the Ship class.  Will encompass all aspects of
//what comprises a ship and add the functionality to access and manipulate
//a ship's data.  (function shit goes here)
//
////////////////////////////////////////////////////////////////////////////////

package com.sngamelib.topdownshooter;

public class Ship extends GroupItem
{
	////////////////////////////////////////////////////////////////////
	//Member Variables
	////////////////////////////////////////////////////////////////////
	
	protected int ShipID;  //unique identifier for the ship
	protected DefenseModule Shield; //member to keep track of ship shields
	protected DefenseModule Armor; // member to keep track of ship armor
	protected DefenseModule Structure; // member to keep track of ship structure
	protected BaseShipType ShipType; // ship type based on faction type
	protected Weapon PriWeap; // ship's primary weapon
	protected Weapon SecWeap; // ship's secondary weapon
	protected DroneGroup drnGrp; // ship's drone group manager
	protected BuffEffectManager buffs; // ship's manager for its added effects (buffs/debuffs)
	protected RepairModule repMod; // ship's repair module
	
	////////////////////////////////////////////////////////////////////
	//Constructors
	////////////////////////////////////////////////////////////////////
	
	Ship()
	{
		ShipID = 0;
		Shield = new DefenseModule();
		Armor = new DefenseModule();
		Structure = new DefenseModule();
		ShipType = null;
		PriWeap = new Weapon();
		SecWeap = new Weapon();
		drnGrp = new DroneGroup();
		buffs = new BuffEffectManager();
		repMod = new RepairModule();
		
	}
	
	Ship(int _sid, DefenseModule _s, DefenseModule _a, DefenseModule _st, BaseShipType _bst,
			Weapon _pw, Weapon _sw, DroneGroup _dg, BuffEffectManager _bem, RepairModule _rm)
	{
		ShipID = _sid;
		Shield = new DefenseModule(_s);
		Armor = new DefenseModule(_a);
		Structure = new DefenseModule(_st);
		ShipType = _bst;
		PriWeap = new Weapon(_pw);
		SecWeap = new Weapon(_sw);
		drnGrp = new DroneGroup(_dg);
		buffs = new BuffEffectManager(_bem);
		repMod = new RepairModule(_rm);
	}
	
	Ship(Ship _shp)
	{
		ShipID = _shp.getShipID();
		Shield = new DefenseModule(_shp.getShield());
		Armor = new DefenseModule(_shp.getArmor());
		Structure = new DefenseModule(_shp.getStructure());
		ShipType = _shp.getShipType();
		PriWeap = new Weapon(_shp.getPrimaryWeapon());
		SecWeap = new Weapon(_shp.getSecondaryWeapon());
		drnGrp = new DroneGroup(_shp.getDroneGroup());
		buffs = new BuffEffectManager(_shp.getBuffManager());
		repMod = new RepairModule(_shp.getRepairModule());
	}
	
	/////////////////////////////////////////////////////////////////////////////
	// Accessor Methods
	/////////////////////////////////////////////////////////////////////////////
	
	public int getShipID()
	{
		return ShipID;
	}
	
	public DefenseModule getShield()
	{
		return Shield;
	}
	
	public DefenseModule getArmor()
	{
		return Armor;
	}
	
	public DefenseModule getStructure()
	{
		return Structure;
	}
	
	public BaseShipType getShipType()
	{
		return ShipType;
	}
	
	public Weapon getPrimaryWeapon()
	{
		return PriWeap;
	}
	
	public Weapon getSecondaryWeapon()
	{
		return SecWeap;
	}
	
	public DroneGroup getDroneGroup()
	{
		return drnGrp;
	}
	
	public BuffEffectManager getBuffManager()
	{
		return buffs;
	}
	
	public RepairModule getRepairModule()
	{
		return repMod;
	}
	
	public void setShipID(int _sid)
	{
		ShipID = _sid;
	}
	
	public void setShield(DefenseModule _s)
	{
		Shield = _s;
	}
	
	public void setArmor(DefenseModule _a)
	{
		Armor = _a;
	}
	
	public void setStructure(DefenseModule _st)
	{
		Structure = _st;
	}
	
	public void setShipType(BaseShipType _bst)
	{
		ShipType = _bst;
	}
	
	public void setPrimaryWeapon(Weapon _pw)
	{
		PriWeap = _pw;
	}
	
	public void setSecondaryWeapon(Weapon _sw)
	{
		SecWeap = _sw;
	}
	
	public void setDroneGroup(DroneGroup _dg)
	{
		drnGrp = _dg;
	}
	
	public void setBuffManager(BuffEffectManager _bem)
	{
		buffs = _bem;
	}
	
	public void setRepairModule(RepairModule _rm)
	{
		repMod = _rm;
	}
	
	/////////////////////////////////////////////////////////////////////////////
	// Worker Methods
	/////////////////////////////////////////////////////////////////////////////
	
	private void damageTaken(AspectType _as, int _da, WeaponEffectType _wet)
	{
		//applies damage (_da) to the proper AspectType (_as) and incorporates the WeaponEffectType (_wet)
	}
	
}
